/**
 *
 * © Bahadir Zeren 2011
 * bzeren@gmail.com
 * No warranties, express or implied, are made for this program.
 *
 */

package org.baatar.opt.genetic.chromosome;

import java.io.Serializable;

/**
 * Factory class for the chromosome objects.
 * 
 */
public interface IChromosomeFactory<T, M> extends Serializable, Cloneable {

    /**
     * 
     */
    public void init();

    /**
     * Generates a chromosome object.
     * 
     * @return IChromosome generated chromosome object.
     */
    public IChromosome<T, M> createChromosome();

    /**
     * Gives the length of the chromosome objects which will be generated by 
     * this chromosome factory object.
     * 
     * @return int length of the generated chromosomes.
     */
    public int getChromosomeLength();

//    /**
//     * Returns the data which represents instance of this chromosome class for
//     * migration.
//     */
//    public M extractMigrationData(IChromosome<T> chromosome);


    /**
     * Clones the this object.
     * 
     * @return Object new cloned object.
     * 
     * @throws CloneNotSupportedException is trown if this object doesnt
     * implements Cloneable interface.
     */
    public Object clone() throws CloneNotSupportedException;
}
